<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/common/header.jsp"%>
<script type="text/javascript" src="../../js/deptSingleSelect.js"></script>
<script type="text/javascript" src="../../js/roleSingleSelect.js"></script>
<a href="" title="用户激活"></a>
<script type="text/javascript">

Ext.onReady(function(){
    Ext.BLANK_IMAGE_URL = ' ../../js/ext/images/default/s.gif'; 
    // ---------------------- Global vars and functions------------------------------
    Ext.SERVER = '<c:url value="/"/>';
  
  Ext.QuickTips.init();
    Ext.override(Ext.form.Field, 
    {   afterRender : Ext.form.Field.prototype.afterRender.createSequence(function()
        {
            var qt = this.qtip;
            if (qt)
            {   Ext.QuickTips.register({
                target:  this,
                title: '',
                css : 'background:#ff0000;',
                text: qt,
                enabled: true,
                showDelay: 20
                });
            }
        })
    });
    

   //---------------------form-------------------
    
      var masterFrom = new Ext.form.FormPanel({
        buttonAlign:'center',
        frame: true,
        layout: 'form',
        labelWidth: 65,
        items: [
        	 {
               name: 'loginId',
                xtype: 'textfield',
               fieldLabel: '登录ID',
               allowBlank: false,
               id: 'loginId'
             },
             {
               name: 'pwd',
               xtype: 'textfield',
               fieldLabel: '密码',
               allowBlank: false,
               id: 'pwd'
             }
        ],
       
        buttons: [
            {
                text: '发送',
                handler: function(){
                    if(masterFrom.getForm().isValid()){
                        masterFrom.getForm().submit({
                            url: '<c:url value="/mail/userMail.do" />',
                            waitTitle: '请等待',                            
                            waitMsg: '信息提交中...',
                            timeout: 30,
                            success: function(response, action){
                            	text = action.response.responseText;
                                    json = Ext.decode(text);
				                    if(json.success == true){  
                                        Ext.Msg.alert('提示', json.msg);
				                    } else {
				                        Ext.Msg.alert('提示', '激活链接已经发到你的邮箱里了!');
				                    }  							      
                            },
						    failure: function(response, action) {
				                    text = action.response.responseText;
                                    json = Ext.decode(text);
				                    if(json.success == false){  
                                        Ext.Msg.alert('提示', json.msg);
				                    } else {
				                        Ext.Msg.alert('提示', '提交失败');
				                    }        
				                                                
				              }
                        });
                    }
                }
            },
            {
            	text:'取消',
            	handler:function()
            	{
            		masterFrom.getForm().reset();
            	}
            }
        ]
    });
    
//-----------------Viewport------------
        var viewport = new Ext.Viewport({
        layout: 'fit',
        border: false,   
        items: [
                    masterFrom
                ]
    });
     
   });   
     
</script>
<%@ include file="/WEB-INF/views/common/footer.jsp"%>
